package cn.t17.appsys.controller;

import cn.t17.appsys.dto.CommonResponse;
import cn.t17.appsys.service.DataDictionaryService;
import cn.t17.appsys.vo.DataDictionaryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * DataDictionaryController class
 *
 * @author Administrator
 * @date 2021/9/16
 */
@RestController
@CrossOrigin(allowCredentials = "true")
@RequestMapping("dict")
public class DataDictionaryController extends  BaseController{

    @Autowired
    private DataDictionaryService dataDictionaryService;

    @RequestMapping(value = "query",method = RequestMethod.GET)
    public CommonResponse<List<DataDictionaryVO>> query(@RequestParam String typeCode){
        List<DataDictionaryVO> dataDictionaryVOS =
                dataDictionaryService.listByTypeCode(typeCode);
        return success(dataDictionaryVOS);
    }
}
